#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main()
{
    int n, k, sum = 0;
    cin >> n >> k;
    double a = 0, b = 0;
    for (int i = 1; i <= n; i++)
    {
        if (i % k == 0)
        {
            a += i;
            sum++;
        }
        else
        {
            b += i;
        }
    }
    printf("%.1f %.1f", a / sum, b / (n - sum));
}